package com.AAA.controller.sas;
import com.AAA.entity.LayData;
import com.AAA.entity.MyPage;
import com.AAA.entity.sas.TSasRecord;
import com.AAA.entity.sas.*;
import com.AAA.service.sas.TSasRecordService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * (TSasRecord)表控制层
 *
 * @author 何泽明
 * @since 2022-10-29 18:18:29
 */
@RestController
@RequestMapping("tSasRecord")
public class TSasRecordController {
    /**
     * 服务对象
     */
    @Autowired
    private TSasRecordService service;

    /**
     * 查询所有的做题记录
     * @return
     */
    @GetMapping("select")
    public LayData getData(MyPage myPage,TSasRecord record){
        return new LayData(service.getAll(myPage,record));
    }

    @GetMapping("{id}")
    public LayData getDetailData(@PathVariable Integer id, MyPage myPage){
        return new LayData(service.getDetailMsg(id,myPage));
    }

    @GetMapping("checkUser")
    public LayData checkUser(TSasRecord record){
        return new LayData(service.checkRecord(record));
    }

    @PostMapping("addRecord")
    public LayData addRecord(TSasRecord record){
        return new LayData(service.insertRecord(record));
    }


    @GetMapping("selectcore")
    public LayData selectcore(MyPage myPage,TSasRecordjieguo tSasRecordjieguo){
        return new LayData(service.selectcore(myPage,tSasRecordjieguo));
    }

    @GetMapping("selectren")
    public  LayData selectren(MyPage myPage,TSasRecordren tSasRecordren){
        return  new LayData(service.selectren(myPage,tSasRecordren));
    }
}

